import api from './index'

// 获取所有分类
export const getCategories = () => {
  return api.get('/categories')
}

// 获取启用的分类
export const getEnabledCategories = () => {
  return api.get('/categories/enabled')
}

// 获取分类详情
export const getCategoryById = (id) => {
  return api.get(`/categories/${id}`)
}

// 创建分类
export const createCategory = (data) => {
  return api.post('/categories', data)
}

// 更新分类
export const updateCategory = (id, data) => {
  return api.put(`/categories/${id}`, data)
}

// 删除分类
export const deleteCategory = (id) => {
  return api.delete(`/categories/${id}`)
}